package com.bitejiuyeke.bitemstemplateservice.rabbitmq;

import com.bitejiuyeke.bitemstemplateservice.domain.MessageDTO;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Producer {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void produceMessage(MessageDTO messageDTO){
        rabbitTemplate.convertAndSend("testQueue",messageDTO);
    }


}
